package com.xinminda.dcf.ui.news.presenter;

import com.xinminda.dcf.base.baserx.RxSubscriber;
import com.xinminda.dcf.bean.NewsSummary;
import com.xinminda.dcf.ui.news.contract.NewsListContract;
import com.xinminda.dcf.utils.ToastUtil;
import java.util.List;

public class NewsListPresenter extends NewsListContract.Presenter {


    @Override
    public void getNewsListDataRequest(String header, String params) {

        mModel.getNewsListData(header, params).subscribe(new RxSubscriber<List<NewsSummary>>(mContext,true){
            @Override
            protected void _onNext(List<NewsSummary> newsSummaryList) {
                mView.returnNewsListData(newsSummaryList);
            }

            @Override
            protected void _onError(String message) {
                ToastUtil.showShort(message);
            }
        });
    }
}